<?php

class menuService extends commonService {

    /**
     *
     * @var menuDao
     */
    protected $pao;

    public function __construct() {
        parent::__construct();
        $this->pao = InitPHP::getDao("menu");
    }

    /**
     * 获取导航
     *
     * @param string $tree
     *            是否返回Tree
     * @param int $status
     *            $status=2表示获取所有导航，$status=1表示获取未禁用导航，$status=0表示获取已禁用导航
     * @return Ambigous <multitype:, multitype:array , boolean, multitype:multitype: >
     */
    public function getMenu($tree = TRUE) {
        $data = $this->pao->getAllByMutiple(array(),array(),array('sort'=>'asc'));
        if ($tree) {
            $data = list_to_tree($data, "id", "pid", "menus");
        }
        return $data;
    }
}